package com.testyourshell.model.test.result;

import java.util.Collection;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.testyourshell.model.IdentifiedEntity;

@Entity
@Table(name = "iteration")
public class Iteration extends IdentifiedEntity {

	private static final long serialVersionUID = 1L;

	@ManyToOne
	@JoinColumn(name = "test_result_id", nullable = false)
	private TestResult testResult;

	@OneToMany(cascade = CascadeType.ALL, mappedBy = "iteration")
	private Collection<Pair> pairs;

	public TestResult getTestResult() {
		return testResult;
	}

	public void setTestResult(TestResult testResult) {
		this.testResult = testResult;
	}

	public Collection<Pair> getPairs() {
		return pairs;
	}

	public void setPairs(Collection<Pair> pairs) {
		this.pairs = pairs;
	}

}
